package itheima.d04;

import itheima.d03.Student;

import java.util.Arrays;
import java.util.Comparator;

public class Test {
    public static void main(String[] args) {
        Studemt[] students = {
                new Studemt("小王", 18, 1.7),
                new Studemt("小张", 19, 1.8),
                new Studemt("小李", 17, 1.6),

        };
        Arrays.sort(students, (o1, o2) -> o1.getAge() - o2.getAge());
        for (int i = 0; i < students.length; i++) {
            System.out.println(students[i]);

        }
    }
}
